package com.zxc.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zxc.dao.ProductMapper;
import com.zxc.entity.Product;
import com.zxc.service.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> implements ProductService {

    @Autowired
    private ProductMapper productMapper;


    @Override
    public List<Product> getProductList(int skipCounts, Integer pageSize) {
        List<Product> productList = productMapper.getProductList(skipCounts,pageSize);
        return productList;
    }

    @Override
    public int selectProductCount() {
        return productMapper.selectCount(new QueryWrapper<>());
    }
}
